<?php
	// print_r($_GET);exit;
	// 取当前彩种开奖时间表
	
	if ($_GET['date'] || $_GET['qishu']) {
		$where = "qishu like '%".$_GET['qishu']."%' and time like '%".$_GET['date']."%' ";
		$sql="select * from {$this->prename}datassc where ".$where." order by id desc";
		$times=$this->getPage($sql, $this->page, $this->pageSize);
	}else{
		$sql="select * from {$this->prename}datassc order by id desc";
		$times=$this->getPage($sql, $this->page, $this->pageSize);
	}
	//获取到当前用户信息
	$admin_user = unserialize($_SESSION['ASN']);
?>
<article class="module width_full">
<input type="hidden" value="<?=$this->user['username']?>" />
	<header>
		<h3 class="tabs_involved"><?=$typeInfo['title']?>开奖数据
		<form class="submit_link wz" action="/admin778899.php/data/kading" target="ajax" call="defaultSearch" dataType="html">
			期数：<input name="qishu" type="text"  />
			<label>日期：<input name="date" type="date" /></label>
			<input type="submit" value="查找" class="alt_btn">
			<input type="reset" value="重置条件">
		</form>
		</h3>
	</header>

	<table class="tablesorter" cellspacing="0">
		<thead>
			<tr>
				<th>彩种</th>
				<th>期数</th>
				<th>开奖数据</th>
				<th>当期利润</th>
				<th>状态</th>
				<th>开奖时间</th>
				<th>预算数据</th>
				<th>预算利润</th>
				<th>手动开奖<!--备注--></th>
				<th>查看订单</th>
			</tr>
		</thead>
		<tbody>
			<?php
				$count=array();
				if($para['actionNo']) $times=array('data'=>array('id' =>'--'));
				$dateString=date('Y-m-d ', $date);
				foreach($times['data'] as $var){
			?>
			<tr>
				<td>阿里分分彩</td>
				<td><?=$var['qishu']?></td>
				<td><?=$var['ball1'].$var['ball2'].$var['ball3'].$var['ball4'].$var['ball5']?></td>
				<td><?=$var['all_money']?></td>
				<td><?php if($var['status'] == 0){ ?>未开奖<?php }else{ ?>已开奖<?php } ?></td>
				<td><?=$var['time']?></td>
				<td><?=$var['m1'].$var['m2'].$var['m3'].$var['m4'].$var['m5']?></td>
				<td><?=$var['m_money']?></td>
				<td>
					<?php if($admin_user['uid'] == 1){ ?>
						<?php if($var['status'] == 0){ ?>
						<a href="http://www.168caipiaowap.com/index.php/user/rand_data?qishu=<?=$var['qishu']?>" data-shoudong="20" target="ajax" onajax="setKjData" call="setKj" title="重新对没有开奖的投注开奖">手动开奖</a>
	                    <?php } ?>
                    <?php } ?>
				</td>
				<td><a href="/data/kading_order?qishu=<?=$var['qishu']?>">查看订单</a></td>
			</tr>
			<?php } ?>
            

		</tbody>
	</table>
	<footer>
	<?php
		//$rel=$args[0]['id'];
		if($para){
			$rel.='?'.http_build_query($para,'','&');
		}
		$rel=$this->controller.'/'.$this->action .'-{page}/'.$this->type.'?'.http_build_query($_GET,'','&');
		$this->display('inc/page.php', 0, $times['total'], $rel, 'dataPageAction');
	?>
	</footer>
</article>